<div  ng-controller="myContactsCtrl">
    <div class="bg-light lter b-b wrapper-md ng-scope">
        <h4 class="m-n font-thin">
            我的人脉/所有用户
        </h4>
    </div>
    <div class="wrapper-md ng-scope">
        <div class="panel panel-default">
            <div class="row wrapper">
            <div class="col-sm-9">
                <form class="form-inline">
                    <div class="form-group">
                        <label class="control-label">昵称</label>
                        <input type="text" ng-model="userListVO.nickName" class="input-sm form-control">
                    </div>
                    <div class="form-group">
                        <label class="control-label">手机号码</label>
                        <input type="text" ng-model="userListVO.mobilePhone" class="input-sm form-control">
                    </div>
                    <div class="form-group">
                        <label class="control-label">下级会员人数
                            <!--<i class="fa fa-question-circle text pos-rlt h6 m-l-xs" popover-placement="top" popover-trigger="mouseenter" popover='*一级会员与二级会员人数总和在该值以上的用户'></i>-->
                        </label>
                        <input type="number" ng-model="userListVO.membershipLeast" class="input-sm form-control" placeholder="最小值">
                        <input type="number" ng-model="userListVO.membershipMost" class="input-sm form-control" placeholder="最大值">
                    </div>
                    <div class="form-group">
                        <label class="control-label">性别</label>
                        <select class="input-sm form-control" ng-model="userListVO.sex"
                                ng-options="item.value as item.name for item in sexObject">
                            <option value="">全部</option>
                        </select>
                    </div>
                    <button class="btn btn-sm btn-default" ng-click="query()">查询</button>
                </form>
            </div>
                </div>
            <div class="table-responsive">
                <table class="table table-striped b-t bg-light">
                    <thead>
                    <tr>
                        <th>头像</th>
                        <th>用户基本信息</th>
                        <th>累计收益金额</th>
                        <th>当前收益积分</th>
                        <th>累计收益积分</th>
                        <th>下级会员人数</th>
                        <th width="200px">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in list">
                        <td><img ng-src="{{item.avatarUrl}}" class="img-size"></td>
                        <td>
                            <span>昵称：{{item.nickName}}<br></span>
                            性别:<span ng-if="item.sex == 0">未知</span>
                            <span ng-if="item.sex == 1">男</span>
                            <span ng-if="item.sex == 2">女</span><br>
                            <span>手机号码：{{item.mobilePhone}}<br></span>
                            <span>地址：{{item.country}}{{item.province}}{{item.city}}<br></span>
                        </td>
                        <td>
                            <span>分销金额：￥{{item.pileSellMoney| number:2}}<br></span>
                            <span>流水奖励：￥{{item.pileIncomeMoney| number:2}}<br></span>
                            <span>返利金额：￥{{item.pileRebateMoney| number:2}}<br></span>
                        </td>
                        <td>
                            <span>金额(现金分)：{{item.currentMoney| number:2}}<br></span>
                            <span>乐积分：{{item.legeIntegral}}<br></span>
                            <span>收益分：{{item.withdrawalMoney| number:2}}<br></span>
                        </td>
                        <td>
                            <span>金额(现金分)：{{item.pileMoney| number:2}}<br></span>
                            <span>乐积分：{{item.pileLegeIntegral}}<br></span>
                            <span>收益分：{{item.pileSellMoney+item.pileRebateMoney+item.pileRebateMoney | number:2}}<br></span>
                        </td>
                        <td>
                            <span>{{item.firstChildrenCount+item.secondChildrenCount}}</span>
                        </td>
                        <td>
                            <button ng-if="item.firstChildrenCount>0" class="btn btn-sm btn-info" ui-sref="app.myContactsFirst({id:item.id,parentName:item.nickName,level:1})">一级会员</button>
                            <button ng-if="item.secondChildrenCount>0" class="btn btn-sm btn-info" ui-sref="app.myContactsSecond({id:item.id,parentName:item.nickName,level:2})">二级会员</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
                <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                    <span class="h6">~未搜索到任何数据~</span>
                </div>
                <div>
                    <circle-loading ng-if="app.loading"></circle-loading>
                </div>
            </div>
            <footer class="panel-footer">
                <div class="row">
                    <div class="col-sm-4 hidden-xs">
                    </div>
                    <div class="col-sm-4 text-center">
                        <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                    </div>
                    <div class="col-sm-4 text-right text-center-xs">
                        <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                    ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                    previous-text="上一页" next-text="下一页"
                                    first-text="首页" last-text="尾页"></pagination>
                    </div>
                </div>
            </footer>
        </div>
    </div>
</div>